frontend: fix plugin settings props not passed#4453
frontend: fix plugin settings props not passed#4453alokdangre wants to merge 2 commits intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: alokdangre The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where data and onDataChange props were not being passed to plugin settings components when displaySettingsComponentWithSaveButton was set to false. The fix ensures these props are always provided to plugin settings components, aligning the implementation with the documented API contract defined in PluginSettingsDetailsProps.
Changes:
- Removed conditional logic that prevented
dataandonDataChangeprops from being passed to plugin settings components when the save button was disabled - Ensures consistent prop passing regardless of the
displaySettingsComponentWithSaveButtonsetting
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
illume
left a comment
There was a problem hiding this comment.
I don't think this is an ok fix, because this makes plugin.displaySettingsComponentWithSaveButton do nothing.
e7eb6a6 to
41db9f7
Compare
Always pass data and onDataChange props to plugin settings components, regardless of the displaySaveButton setting. This fixes a bug where these props were only passed when the save button was displayed.
Pass data/onDataChange props to plugin settings components in both modes, while keeping explicit-save plugins unchanged.\n\nFor plugins registered without the save button, onDataChange now persists immediately through onSave.\n\nAdd tests covering both save-button and no-save-button flows.
Summary
Fix plugin settings behavior so
registerPluginSettingscomponents always receivedataandonDataChange, while preserving existing save-button semantics.Related Issue
Fixes #4062
Changes
dataandonDataChangeto function components used in plugin settings.displaySettingsComponentWithSaveButtonbehavior:true: explicit save flow remains unchanged.false: changes are persisted immediately viaonSavefromonDataChange.Steps to Test
displaySaveButton=trueand confirm edits do not persist until Save.displaySaveButton=falseand confirm edits persist immediately throughonDataChange.Notes for the Reviewer
This addresses the original props mismatch while keeping the save-button contract intact, which avoids making
displaySettingsComponentWithSaveButtona no-op.